<?php 
session_start();
if(isset($_SESSION['userid'])){
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">	
	<title>FritoLay</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="">
	<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>

	

	<!-- SCRIPT PARA TOMAR SCREENSHOT -->
	<script type="text/javascript" src="testJs/html2canvas.js"></script>


	<!-- END SCRIPTS FOR PDF -->
	<!--[if lt IE 9]>
	<script src="js/html5.js"></script>
	<![endif]-->

	<!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
	<!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
	<!--script src="js/less-1.3.3.min.js"></script-->
	<!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->

<script language="javascript" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.jqplot.css" />

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">	


<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/favicon.ico">


<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>

<!-- BEGIN GRAFICAS -->
<link class="include" rel="stylesheet" type="text/css" href="css/jquery.jqplot.min.css" />
<link rel="stylesheet" type="text/css" href="css/examples.min.css" />
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />


<!-- Don't touch this! -->


<script class="include" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
<!-- End Don't touch this! -->

<!-- Additional plugins go here -->
<script class="include" type="text/javascript" src="plugins/jqplot.cursor.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.dateAxisRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.logAxisRenderer.min.js"></script>
<!-- End additional plugins -->

<!-- END GRAFICAS-->


<!--BEGIN SCRIPTS/CSS GRAFICOS -->
<!-- css's -->
<link class="include" rel="stylesheet" type="text/css" href="css/jquery.jqplot.min.css" />
<link rel="stylesheet" type="text/css" href="css/examples.min.css" />
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shCoreDefault.min.css" />
<link type="text/css" rel="stylesheet" href="syntaxhighlighter/styles/shThemejqPlot.min.css" />

<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
<script class="include" type="text/javascript" src="js/jquery.min.ie.js"></script>
<!-- END SCRIPTS/CSS GRAFICOS -->
<style>
	/* Set the fixed height of the footer here */
	#push,
	#footer {
		height: 60px;
	}
	#footer {
		background-color: #eee;
	}

	/* Lastly, apply responsive CSS fixes as necessary */
	@media (max-width: 767px) {
		#footer {
			margin-left: -20px;
			margin-right: -20px;
			padding-left: 20px;
			padding-right: 20px;
		}
	}
</style>

<!-- BEGIN TIME PICKER -->
<link href="css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="js/bootstrap-datetimepicker.min.js"></script>
<!-- END TIME PICKER -->


<!-- BEGIN AJAX ESTADISTICAS Y GRAFICAS -->
<script>

	function hola(){
		
		var currentdate = new Date(); 
		var datetime =  currentdate.getDate() + "-"+ (currentdate.getMonth()+1)  + "-" 
		+ currentdate.getFullYear() + "-"  
		+ currentdate.getHours() + "-"  
		+ currentdate.getMinutes() + "-" 
		+ currentdate.getSeconds();
		
		var direcc="reportes_Consulta/repo-"+datetime;
		html2canvas($("#contenedor-reporte"), {
			onrendered: function(canvas) {
				var dataURL = canvas.toDataURL("image/png");

                           // $('.imageHolder').append('<img src="'+dataURL+'" />');                            
                           // $.post('L1_5A_consulta_auxPDF.php',{image: dataURL});

                           $.post('L1_5A_consulta_auxPDF.php',{image: dataURL,direc: direcc},function(data){                                
                                // window.alert(data);
                                $('#test').html(data);
                                window.location.href = 'download.php?img=reportes_Consulta\/repo-'+datetime+'.pdf';

                            });

                       } 
                   });
		
		
		window.alert("Archivo PDF de reporte generado.");		
		return false;
	}




	function showUser()
	{

		var fecha1 = document.forms["formFechas"]["ParametroFechaInicial"].value;
		var fecha2 = document.forms["formFechas"]["ParametroFechaFinal"].value;

		var f1 = $.trim(fecha1);
		var f2 = $.trim(fecha2);

		if (f1 == "" || f2 == "") {
			window.alert("Ningun campo de fecha debe estar vacio.");
			return false;
		}

		if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

xmlhttp.onreadystatechange=function()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	{
//document.getElementById("grafi").innerHTML=xmlhttp.responseText;    
var resultado = xmlhttp.responseText; 
var res = resultado.split("::");  		
document.getElementById("tablaEstadisticasTiempoReal").innerHTML=res[0];   
var datos = "Graficas - Fecha Inicial:" + f1 + " / Fecha Final: " + f2 ;
document.getElementById("tituloReporte").innerHTML= "<center><h2>M&aacute;quina 5, Tubo A - Linea 1500</h2><br><h2  class=\"panel-title\">Consulta - Fecha Inicial:" + f1 + " / Fecha Final: " + f2 + "</h2></center>";
DrawVelocidadPromedioGrafica(res[1]);
DrawUnidadesProducidasGrafica(res[2]);
DrawUnidadesDesperdicioGrafica(res[3]);
DrawCantidadParosGrafica(res[4], res[5]);
}
}
xmlhttp.open("POST","L1_5A_consulta_auxGetCadenas.php",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("f1=" + fecha1 + "&f2=" + fecha2);
return false;
}
</script>
<!-- END AJAX ESTADISTICAS -->


</head>

<body>
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<nav class="navbar navbar-default" role="navigation">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="#">FritoLay</a>
					</div>

					<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
						<ul class="nav navbar-nav">
							<li class="active">
								<a href="L1_1A_consulta.php?m=5A">Consultas</a>
							</li>
							<li>
								<a href="L1_1A_Treal.php?m=5A">Tiempo Real</a>
							</li>	
							<li>
								<a href="L1_1A_reporteJornada1.php?m=5A">Jornada 1</a>
							</li>
							<li>
								<a href="L1_1A_reporteJornada2.php?m=5A">Jornada 2</a>
							</li>					
							<li class="dropdown">
							 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Reportes<strong class="caret"></strong></a>
							<ul class="dropdown-menu">								
								<li class="divider">
								</li>
								<li>
									<a href="reportes_Treal">Reportes Tiempo Real</a>
								</li>
								<li>
									<a href="reportes_Consulta">Reportes de Consultas</a>
								</li>
								<li>
									<a href="reportes_Jornada1">Reportes de Jornada 1</a>
								</li>
								<li>
									<a href="reportes_Jornada2">Reportes de Jornada 2</a>
								</li>
								<li>
									<a href="reportes_JornadaTotal">Reportes de Jornada Total</a>
								</li>	
								<li class="divider">
								</li>							
							</ul>
							</li>
							<li class="dropdown">
							 <a href="#" class="dropdown-toggle" data-toggle="dropdown">Ayuda<strong class="caret"></strong></a>
							<ul class="dropdown-menu">								
								<li class="divider">
								</li>
								<li>
									<a href="#" onClick="manualTecnico()" >Manual T&eacute;cnico</a>
								</li>
								<li>
									<a href="#" onClick="manualUsuario()" >Manual de Usuario</a>
								</li>								
								<li class="divider">
								</li>							
							</ul>
							</li>							
						</ul>	
						<ul class="nav navbar-nav navbar-right">
								<li>
									<a href="CerrarSesion.php">Cerrar Sesi&oacute;n</a>
								</li>
						</ul>				
					</div>				
				</nav>
				<div class="tabbable" id="tabs-665848">
					<ul class="nav nav-tabs">
						<li class="active">
							<a href="#panel-Linea1" data-toggle="tab">Linea 1500</a>
						</li>
						<li>
							<a href="#panel-Linea2" data-toggle="tab">Linea 2</a>
						</li>
						<li>
							<a href="#panel-Linea3" data-toggle="tab">Linea 3</a>
						</li>
						<li>
							<a href="#panel-Linea4" data-toggle="tab">Linea 4</a>
						</li>
						<li>
							<a href="#panel-Linea5" data-toggle="tab">Linea 5</a>
						</li>
						<li>
							<a href="#panel-Linea6" data-toggle="tab">Linea 6</a>
						</li>
						<li>
							<a href="#panel-Linea7" data-toggle="tab">Linea 7</a>
						</li>

					</ul>
					<div class="tab-content">
						<div class="tab-pane active" id="panel-Linea1">
							<div class="tabbable" id="tabs-345632">
								<ul class="nav nav-tabs">
									<li>
										<a href="L1_1A_consulta.php">Maquina 1A</a>
									</li>
									<li>
										<a href="L1_1B_consulta.php">Maquina 1B</a>
									</li>
									<li>
										<a href="L1_2A_consulta.php">Maquina 2A</a>
									</li>
									<li>
										<a href="L1_2B_consulta.php" >Maquina 2B</a>
									</li>
									<li>
										<a href="L1_3A_consulta.php" >Maquina 3A</a>
									</li>
									<li>
										<a href="L1_3B_consulta.php" >Maquina 3B</a>
									</li>
									<li>
										<a  href="L1_4A_consulta.php">Maquina 4A</a>
									</li>
									<li>
										<a href="L1_4B_consulta.php" >Maquina 4B</a>
									</li> 
									<li class="active">
										<a href="#panel-M5AL1" data-toggle="tab"  >Maquina 5A</a>
									</li>
									<li >
										<a href="L1_5B_consulta.php" >Maquina 5B</a>
									</li>																		
								</ul>
								<div class="tab-content">
									<div class="tab-pane active" id="panel-M1AL1">
										<div class="well">
											<form  role="form" name="formFechas" method="POST" onSubmit="return showUser()">
												<div class="form-group">
													<div id="datetimepickerFechaInicial" class="input-append date" >
														<label for="ParametroFechaInicial">Fecha y Hora Inicial</label>
														<input type="text" id="ParametroFechaInicial" name="ParametroFechaInicial">
														<span class="add-on">
															<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
														</span>
													</div>
													<script type="text/javascript">
														$(function() {
															$('#datetimepickerFechaInicial').datetimepicker({
																format: 'yyyy-MM-dd hh:mm:ss',
															});
														});
													</script>									
												</div>
												<div class="form-group">
													<div id="datetimepickerFechaFinal" class="input-append date" >
														<label for="ParametroFechaFinal">Fecha y Hora Final</label>
														<input type="text" id="ParametroFechaFinal" name="ParametroFechaFinal">
														<span class="add-on">
															<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
														</span>
													</div>
													<script type="text/javascript">
														$(function(){
															$('#datetimepickerFechaFinal').datetimepicker({
																format: 'yyyy-MM-dd hh:mm:ss',
																language: 'es-ES'
															});
														});
													</script>
												</div>
												<input class="btn btn-primary" type="submit" title="Consultar">
											</form>	
										</div>


										<div class="container" id="contenedor-reporte">
											<div class="row clearfix">
												<div class="col-md-12 column">
													
													<div class="panel panel-default">
														<div id="tituloReporte" class="panel-heading">

														</div>
														<div class="well">
															<div class="btn-group btn-group-xl">
																<button class="btn btn-default" type="button" title="Exportar a PDF" onclick="hola()">
																	<em class="glyphicon glyphicon-file"></em> 
																	Exportar PDF
																</button> 
																<button class="btn btn-default" type="button">
																	<em class="glyphicon glyphicon-download-alt"></em>
																</button>
																<button class="btn btn-default" type="button">
																	<em class="glyphicon glyphicon-floppy-save"></em>
																</button> 
																<button class="btn btn-default" type="button">
																	<em class="glyphicon glyphicon-align-justify"></em>
																</button>
															</div>
														</div>
														<br>	
														<div class="panel panel-default">
															<div class="panel-heading">
																<h3 class="panel-title">
																	Estadisticas
																</h3>
															</div>
															<div class="panel-body" id="tablaEstadisticasTiempoReal">

															</div>
															<div class="panel-footer">
																Estadisticas Resultantes
															</div>
														</div>																
														<div class="panel-body" id="divGraficasTiempoReal">
															<!-- BEGIN AJAX ESCRITO DESDE PHP GETGRAFICASTIEMPOREAL.PHP -->
															<div class="row clearfix">
																<div class="col-md-12 column">
																	<div class="panel panel-default">
																		<div class="panel-heading">
																			<h3 class="panel-title">
																				Velocidad 
																			</h3>
																		</div>
																		<div class="panel-body" id="contenedor-chart1">
																			<span class="badge" id="info1">Velocidad: </span>
																			<div class="container pull-left" id="chart1" style="padding-left: 5px; padding-right: 5px; width:100%;"></div>
																		</div>
																		<div class="panel-footer">
																			Velocidad 
																		</div>
																	</div>
																</div>
															</div>
															<div class="row clearfix">
																<div class="col-md-12 column">
																	<div class="panel panel-default">
																		<div class="panel-heading">
																			<h3 class="panel-title">
																				Unidades Producidas 
																			</h3>
																		</div>
																		<div class="panel-body" id="contenedor-chart2">
																			<span class="badge" id="info2">Unidades Producidas: </span>
																			<div class="container pull-left" id="chart2" style="padding-left: 5px; padding-right: 5px; width:100%;"></div>
																		</div>
																		<div class="panel-footer">
																			Unidades Producidas
																		</div>
																	</div>
																</div>
															</div>
															<div class="row clearfix">
																<div class="col-md-12 column">
																	<div class="panel panel-default">
																		<div class="panel-heading">
																			<h3 class="panel-title">
																				Unidades Desperdicio
																			</h3>
																		</div>
																		<div class="panel-body" id="contenedor-chart3">
																			<span class="badge" id="info3">Unidades Desperdicio: </span>
																			<div class="container pull-left" id="chart3" style="padding-left: 5px; padding-right: 5px; width:100%;">
																				
																			</div>
																		</div>
																		<div class="panel-footer">
																			Unidades de Desperdicio
																		</div>
																	</div>
																</div>
															</div>
															<div class="row clearfix">
																<div class="col-md-12 column">
																	<div class="panel panel-default">
																		<div class="panel-heading">
																			<h3 class="panel-title">
																				Numero de Paros
																			</h3>
																		</div>
																		<div class="panel-body" id="contenedor-chart4">
																			<span class="badge" id="info4">Cantidad de Paros: </span>
																			<div class="container pull-left" id="chart4" style="padding-left: 5px; padding-right: 5px; width:100%;">
																				
																			</div>
																		</div>
																		<div class="panel-footer">
																			Cantidad de Paros
																		</div>
																	</div>
																</div>
															</div>
														</div>
														<div class="panel-footer">
															Consultas
														</div>
														<!-- END AJAX ESCRITO DESDE PHP GETGRAFICASTIEMPOREAL.PHP -->
													</div>

												</div>												
											</div>
											<div id="test">

											</div>
										</div>
									</div>									
								</div>
							</div>
						</div>
						<div class="tab-pane" id="panel-Linea2">
							<p>
								Linea 2.
							</p>
						</div>
						<div class="tab-pane" id="panel-Linea3">
							<p>
								Linea 3.
							</p>
						</div>
						<div class="tab-pane" id="panel-Linea4">
							<p>
								Linea 4.
							</p>
						</div>
						<div class="tab-pane" id="panel-Linea5">
							<p>
								Linea 5.
							</p>
						</div>
						<div class="tab-pane" id="panel-Linea6">
							<p>
								Linea 6.
							</p>
						</div>
						<div class="tab-pane" id="panel-Linea7">
							<p>
								Linea 7.
							</p>
						</div>
					</div>
				</div>			
			</div>
		</div>
	</div>

	<script class="code" type="text/javascript">

		function DrawVelocidadPromedioGrafica(cadenaVelocidadPromedio){
			document.getElementById("chart1").innerHTML=""; 
		//window.alert(cadenaVelocidadPromedio);
		var resultado = cadenaVelocidadPromedio;
		var res = resultado.split(";;");
		var v1 = res[0];
		var v2 = res[1];			
		var s2 = v1.split(",");
		var s3 = v2.split(",");
		var s4 = new Array();
		 var grid = {
        gridLineWidth: 1.5,
        gridLineColor: 'rgb(235,235,235)',
        drawGridlines: true
    };

		for (var i = 0; i <= s2.length-1; i++) {			
			var aux = parseFloat(s2[i]);
			s4[i]=aux;			
				//window.alert(s4[i] + "= " + typeof s4[i]);
			};
			$.jqplot.config.enablePlugins = true;														
			var plot1 = $.jqplot('chart1', [s4], {
// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
animate: !$.jqplot.use_excanvas,
seriesDefaults:{
	renderer:$.jqplot.BarRenderer,
	pointLabels: { show: true }
},
axes: {
	xaxis: {
		renderer: $.jqplot.CategoryAxisRenderer,
		ticks: s3,
		tickRenderer: $.jqplot.CanvasAxisTickRenderer
,
		tickOptions: {
  
          angle: -45,
          fontSize: '8pt'
        }
	},
	yaxis: {
		autoScale: false
	}
}
,
//LINEA DE GRAFICA
grid: grid,
        canvasOverlay: {
            show: true,
            objects: [
                {horizontalLine: {
                    name: 'barney',
                    y: 55,
                    lineWidth: 6,
                    color: 'rgb(89, 198, 154)',
                    shadow: false
                }}
				    ]
        }
,
highlighter: { show: false }
});
			$('#chart1').bind('jqplotDataClick', 
				function (ev, seriesIndex, pointIndex, data) {				
					$('#info1').html('Velocidad: '+data[1] + " Bolsas/min.");
				});	
		}	
	</script>

	<script type="text/javascript">
		function DrawUnidadesProducidasGrafica(cadenaUnidadesProducidas){		
			//window.alert("CADENA: " +cadenaUnidadesProducidas);
			document.getElementById("chart2").innerHTML = "";
			var resultado = cadenaUnidadesProducidas;
			var res = resultado.split(";;");
			var v1 = res[0];
			var v2 = res[1];			
			var s2 = v1.split(",");
			var s3 = v2.split(",");
			var s4 = new Array();

			for (var i = 0; i <= s2.length-1; i++) {			
			var aux = parseFloat(s2[i]);
			s4[i]=aux;			
				//window.alert(s4[i] + "= " + typeof s4[i]);
			};

			// for (var i = 0; i <= s2.length-1; i++) {				
			// 	var aux = parseFloat(s2[i]);
			// 	if (i == 0) {
			// 		s4[i]=aux;	
			// 	}else{
			// 		//restar la cantidad con [i-1]
			// 		var total = aux - parseFloat(s2[i-1]);
			// 		if (total < 0) {
			// 			s4[i]=aux;
			// 		}else{
			// 			s4[i]=total;
			// 		}
			// 	}
				
				//window.alert(s4[i] + "= " + typeof s4[i]);
			// }; 
			$.jqplot.config.enablePlugins = true;														
			var plot1 = $.jqplot('chart2', [s4], {
				// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
				animate: !$.jqplot.use_excanvas,
				seriesDefaults:{
					renderer:$.jqplot.BarRenderer,
					pointLabels: { show: true }
				},
				axes: {
					xaxis: {
						renderer: $.jqplot.CategoryAxisRenderer,
						ticks: s3,
		tickRenderer: $.jqplot.CanvasAxisTickRenderer
,
		tickOptions: {
  
          angle: -45,
          fontSize: '8pt'
        }
					},	
					yaxis: {
						autoScale: false
					}
				},
				highlighter: { show: false}
			});

			$('#chart2').bind('jqplotDataClick', 
				function (ev, seriesIndex, pointIndex, data) {
					$('#info2').html('Unidades Producidas: '+data[1] + " Bolsas");
			});	
		}	
	</script>

	<!-- Don't touch this! -->

<!-- SCRIPT PARA PRESENTAR LAS UNIDADES DE DESPERDICIO -->
<script type="text/javascript">
	function DrawUnidadesDesperdicioGrafica(cadenaUnidadesDesperdicio){		
			// window.alert("CADENA: " +cadenaUnidadesDesperdicio);
			document.getElementById("chart3").innerHTML = "";
			var resultado = cadenaUnidadesDesperdicio;
			var res = resultado.split(";;");
			var v1 = res[0];
			var v2 = res[1];			
			var s2 = v1.split(",");
			var s3 = v2.split(",");
			var s4 = new Array();

			for (var i = 0; i <= s2.length-1; i++) {			
				var aux = parseFloat(s2[i]);
				s4[i]=aux;			
				// window.alert(s4[i] + "= " + typeof s4[i]);
			}; 
			$.jqplot.config.enablePlugins = true;														
			var plot1 = $.jqplot('chart3', [s4], {
				// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
				animate: !$.jqplot.use_excanvas,
				seriesDefaults:{
					renderer:$.jqplot.BarRenderer,
					pointLabels: { show: true }
				},
				axes: {
					xaxis: {
						renderer: $.jqplot.CategoryAxisRenderer,
						ticks: s3,
		tickRenderer: $.jqplot.CanvasAxisTickRenderer
,
		tickOptions: {
  
          angle: -45,
          fontSize: '8pt'
        }
					},	
					yaxis: {
						autoScale: false
					}
				},
				highlighter: { show: false}
			});

			$('#chart3').bind('jqplotDataClick', 
				function (ev, seriesIndex, pointIndex, data) {
					$('#info3').html('Unidades Desperdicio: '+data[1] + " Bolsas.");
			});	
		}	
</script>

<!-- SCRIPT PARA PRESENTAR LA CANTIDAD DE PAROS -->
<script type="text/javascript">
	function DrawCantidadParosGrafica(cadenaCantidadParos, cadenaMinutos){		
			// window.alert("CADENA: " +cadenaUnidadesDesperdicio);
			document.getElementById("chart4").innerHTML = "";
			var resultado = cadenaCantidadParos;
			var res = resultado.split(";;");
			var v1 = res[0];
			var v2 = res[1];			
			var s2 = v1.split(",");
			var s3 = v2.split(",");
			var s4 = new Array();

			var resMinutos = cadenaMinutos;
			var resMin = resMinutos.split(";;");
			var auxMinutos = resMin[0];
			var minutos = auxMinutos.split(",");

			for (var i = 0; i <= s3.length - 1; i++) {
				 s3[i] = s3[i] + " " + minutos[i] + " minutos";				
			};

			for (var i = 0; i <= s2.length-1; i++) {			
				var aux = parseFloat(s2[i]);
				s4[i]=aux;			
				// window.alert(s4[i] + "= " + typeof s4[i]);
			}; 
			$.jqplot.config.enablePlugins = true;														
			var plot1 = $.jqplot('chart4', [s4], {
				// Only animate if we're not using excanvas (not in IE 7 or IE 8)..
				animate: !$.jqplot.use_excanvas,
				seriesDefaults:{
					renderer:$.jqplot.BarRenderer,
					pointLabels: { show: true }
				},
				axes: {
					xaxis: {
						renderer: $.jqplot.CategoryAxisRenderer,
						ticks: s3,
		tickRenderer: $.jqplot.CanvasAxisTickRenderer
,
		tickOptions: {
  
          angle: -45,
          fontSize: '8pt'
        }
					},	
					yaxis: {
						autoScale: false
					}
				},
				highlighter: { show: false}
			});

			$('#chart4').bind('jqplotDataClick', 
				function (ev, seriesIndex, pointIndex, data) {
					$('#info4').html('Cantidad de Paros: '+data[1] + " paros.");
			});	
		}	
</script>

<!-- script para manuales -->
<script type="text/javascript" >
	function manualTecnico(){
		window.location.href = 'download.php?img=Ayuda/ManualTecnico.pdf';
		return false;
	}

	function manualUsuario(){
		window.location.href = 'download.php?img=Ayuda/ManualUsuario.pdf';
		return false;
	}
</script>


	<script class="include" type="text/javascript" src="js/jquery.jqplot.min.js"></script>
	<script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
	<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
	<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
	<!-- Additional plugins go here -->

	<script class="include" type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
	<script class="include" type="text/javascript" src="plugins/jqplot.pieRenderer.min.js"></script>
	<script class="include" type="text/javascript" src="plugins/jqplot.categoryAxisRenderer.min.js"></script>
	<script class="include" type="text/javascript" src="plugins/jqplot.pointLabels.min.js"></script>
	<script class="include" type="text/javascript" src="plugins/jqplot.canvasTextRenderer.min.js"></script>
<script class="include" type="text/javascript" src="plugins/jqplot.canvasAxisTickRenderer.min.js"></script>


	<!-- End additional plugins -->
	<!-- DIBUJAR LINEAS INICIA -->
	 <script language="javascript" type="text/javascript" src="plugins/jqplot.canvasOverlay.min.js"></script>
<!-- DIBUJAR LINEAS TERMINA -->
	
</body>
</html>
<?php 
}else{header( 'Location: ErrNoSession.php');}
?>
